<template>
<div class="test">
  <el-button  @click="test">Button</el-button>
  count:{{v}}
  <el-button  @click="sayHello">SayHello</el-button>
  <TestComp class="demo"/>
  <p>
    <router-link to="/a">A</router-link>
    <router-link to="/b">B</router-link>
  </p>
  <router-view></router-view>
</div>
</template>

<script>
import TestComp from "./TestComp";
import sayHello from "./test";
export default {
  name: "index",
  components: {TestComp},
  data(){
    return {
      v:0
    }
  },
  methods:{
    test(){
      this.v++
    },
    sayHello(){
      sayHello()
    }
  }
}
</script>

<style lang="less">
.test{
  .demo{
    color: red;
  }
}
</style>
